<script>
	upload.type='court';
	upload.formid='courtForm';
	upload.setAppend=function(imgurl){
		return '<div style="margin:10px"><a href="'+imgurl+'" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;border:1px #cccccc dashed" src="'+imgurl+'" /></a> 图片说明:<input type="text" name="imgIntro[]" value="" /><input type="hidden" name="imgUrl[]" value="'+imgurl+'" />　<input type="button" value="插入" onclick="commonEffection.InserImg(\''+imgurl+'\');" />　<input type="button" value="删除" onclick="upload.delimg(this);" /></div>';
	}
</script>
<div class="frame_introDiv">
<form name="courtForm" id="courtForm" action="adminb-court-doadd" enctype="multipart/form-data"  method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <td width="20%" class="ri-bbgg"> Case name</td>
      <td width="80%" class="le"><input type="text" value="" name="court_name" /></td>
    </tr>
	<tr>
      <td class="ri-bbgg"> The defendant username</td>
      <td class="le"><input type="text" value="" name="defendant_username" /></td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Case introduction</td>
      <td class="le">
	  	<textarea name="case_intro" style="width:500px;height:100px"></textarea>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Prosecution content</td>
      <td class="le">
	  	<?=$this->oFCKeditor->create();?>
	  </td>
    </tr>
	<tr>
	  <td class="ri-bbgg"><span class="red">*</span> 上传图片：</td>
	  <td class="le"><span><input name="productpic" type="file" id="productpic" /></span>　<input type="button" onclick="upload.uploadimg(this);" value="上传" />　( 可连续上传多幅 )</td>
	</tr>
	<tr>
	  <td class="ri-bbgg">图片效果：</td>
	  <td class="le">
		<div id="productImages"></div>
		<iframe id="productIframe" width="0" height="0" name="productIframe"></iframe>
	  </td>
	</tr>
	<tr>
      <td class="ri-bbgg"> 要求被告赔偿虚拟货币</td>
	  <td class="le">
	   <input value="" name="compensation" />
	  </td> 
	</tr>
	<tr>
      <td class="ri-bbgg"> 问题产品链接地址(可选)</td>
	  <td class="le">
	   <input value="" name="product_url" /> ( 填写该产品链接地址 )
	  </td> 
	</tr>
    <tr>
      <td colspan="2" class="se" style="text-align:center"><span>
        <input name="button2" type="button" class="iput" onclick="checkform();" value="Save" />&nbsp;&nbsp;
      </span><font color="#FF0000"></font></td>
    </tr>
  </table>
  </form>
</div>
<script>
function checkform(){
	var court_name=trim($('input[name="court_name"]').val());
	if(court_name==''){
		alert('Please fill in the name of cases!');
		return false;
	}
	var defendant_username=trim($('input[name="defendant_username"]').val());
	if(defendant_username==''){
		alert('Please fill in the defendant name!');
		return false;
	}
	var case_intro=trim($('textarea[name="case_intro"]').val());
	if(case_intro==''){
		alert('Please fill in the case introduction!');
		return false;
	}
	var compensation=trim($('input[name="compensation"]').val());
	if(!numTest(compensation)){
		alert('Please fill in the compensation!');
		return false;
	}else if(compensation>100000){
		alert('Compensation points should not be more than 100000!');
		return false;
	}
	var content = trim(FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true ));
	if(content==''){
		alert('Please fill in the prosecution content!');
		return false;
	}
	$('#courtForm').submit();
}
</script>